package DVDTEST;

import java.util.Comparator;

public class DVD {
    public int getSerial() {
        return serial;
    }

    public void setSerial(int serial) {
        this.serial = serial;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getOutDate() {
        return outDate;
    }

    public void setOutDate(int outDate) {
        this.outDate = outDate;
    }

    public String getOut() {
        return out;
    }

    public void setOut(String out) {
        this.out = out;
    }

    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public int getPrice() {
        return time;
    }

    public void setPrice(int time) {
        this.time = time;
    }

    private int serial;    //序号
    private String state;  //状态
    private String name;   //名称
    private int outDate;   //借出日期
    private String out;
    private int price;   //借出日期
    private int time;      //借出次数

    public DVD() {
    }

    public DVD(int serial, String state, String name, int outDate, int time, int price) {
        this.serial = serial;
        this.state = state;
        this.name = name;
        this.outDate = outDate;
        this.time = time;
        this.price = price;
    }


    //查看格式
    public String toString() {
        return this.getSerial() + "\t" + this.getState() + "\t<<" + this.getName() + ">>\t" + this.getOut() + "\t" + this.getTime() + "次" + "\t" + this.getPrice() + "元";
    }

    static class OwnComparator implements Comparator<DVD> {
        public int compare(DVD d1, DVD d2) {
            return Math.max(d1.getTime(), d2.getTime());
        }
    }
}